import React, { Component } from 'react'

export default class List extends Component {
    constructor(props) {
        super(props)

        this.state = {

        }
    }

    render() {
        return (
            <div>
               
                <h1>已完成</h1>
                <ul>
                    {
                        this.props.list.map((item, index) => {
                            return <li key={index} className={item.status == 0 ? "hidde" : ""} >
                                <input type="checkbox" onChange={() => {
                                    this.props.che(index)
                                }} checked={item.status} />
                                {item.title}
                            </li>
                        })
                    }
                </ul>
                <h1>未完成</h1>
                <ul>
                    {
                        this.props.list.map((item, index) => {
                            return <li key={index} className={item.status == 1 ? "hidde" : ""} >
                                <input type="checkbox" onChange={() => {
                                    this.props.che(index)
                                }} checked={item.status} />
                                {item.title}
                            </li>
                        })
                    }
                </ul>
            </div>
        )
    }
}
